<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>执行一个mysql查询</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.real-escape-string.html">mysqli::real_escape_string</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.reap-async-query.html">mysqli::reap_async_query</a></div>
 <div class="up"><a href="class.mysqli.html">MySQLi</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqli.real-query" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli::real_query</h1>
  <h1 class="refname">mysqli_real_query</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">mysqli::real_query</span> -- <span class="refname">mysqli_real_query</span> &mdash; <span class="dc-title">执行一个mysql查询</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli.real-query-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
   <div class="methodsynopsis dc-description">
    <span class="type">bool</span> <span class="methodname"><strong>mysqli::real_query</strong></span>
     ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$query</code></span>
    )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>mysqli_real_query</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.mysqli.html" class="type mysqli">mysqli</a></span> <code class="parameter">$link</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$query</code></span>
   )</div>

  <p class="para rdfs-comment">
  执行一个单条数据库查询,
  其结果可以使用<span class="function"><a href="mysqli.store-result.html" class="function">mysqli_store_result()</a></span>或<span class="function"><a href="mysqli.use-result.html" class="function">mysqli_use_result()</a></span>检索或存储.
  </p>
  <p class="para">
  为了确定给定的查询是否真的返回一个结果集,
  可以查看<span class="function"><a href="mysqli.field-count.html" class="function">mysqli_field_count()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli.real-query-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
link</code></em></dt>
<dd>
<p class="para">仅以过程化样式：由<span class="function"><a href="function.mysqli-connect.html" class="function">mysqli_connect()</a></span> 或 <span class="function"><a href="mysqli.init.html" class="function">mysqli_init()</a></span>
返回的链接标识。</p></dd>

    
     <dt>
<em><code class="parameter">query</code></em></dt>

     <dd>

      <p class="para">
      查询字符串
      </p>
      <p class="para">
      查询中的数据可以进行<a href="mysqli.real-escape-string.html" class="link">属性转义</a>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysqli.real-query-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mysqli.real-query-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="mysqli.query.html" class="function" rel="rdfs-seeAlso">mysqli_query()</a> - 对数据库执行一次查询</span></li>
    <li class="member"><span class="function"><a href="mysqli.store-result.html" class="function" rel="rdfs-seeAlso">mysqli_store_result()</a> - Transfers a result set from the last query</span></li>
    <li class="member"><span class="function"><a href="mysqli.use-result.html" class="function" rel="rdfs-seeAlso">mysqli_use_result()</a> - Initiate a result set retrieval</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.real-escape-string.html">mysqli::real_escape_string</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.reap-async-query.html">mysqli::reap_async_query</a></div>
 <div class="up"><a href="class.mysqli.html">MySQLi</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
